using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using MAPDavy.Entities;

namespace MAPDavy.Repository.Mapping
{
	public class SubjectMap : EntityTypeConfiguration<Subject>
	{
		public SubjectMap()
		{
			// Primary Key
			this.HasKey(t => t.Id);

			// Properties
			this.Property(t => t.NameSubject)
				.IsRequired()
				.HasMaxLength(100);
				
			// Table & Column Mappings
			this.ToTable("Subject");
			this.Property(t => t.Id).HasColumnName("Id");
			this.Property(t => t.NameSubject).HasColumnName("NameSubject");
			this.Property(t => t.comentario).HasColumnName("comentario");
		}
	}
}

